package com.llsydn.a01androidh5;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

/**
 * @author lilinshen
 * @title android与h5互相调用
 * @description 请填写相关描述
 * @date 2018/10/19 12:02
 */
public class MainActivity extends Activity implements View.OnClickListener {

    private Button btnJavaAndJs;
    private Button btnJsCallJava;
    private Button btnJsCallPhone;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViews();
    }

    /**
     * Find the Views in the layout<br />
     * <br />
     * Auto-created on 2018-10-19 13:44:44 by Android Layout Finder
     * (http://www.buzzingandroid.com/tools/android-layout-finder)
     */
    private void findViews() {
        btnJavaAndJs = (Button) findViewById(R.id.btn_java_and_js);
        btnJsCallJava = (Button) findViewById(R.id.btn_js_call_java);
        btnJsCallPhone = (Button) findViewById(R.id.btn_js_call_phone);
        btnJavaAndJs.setOnClickListener(this);
        btnJsCallJava.setOnClickListener(this);
        btnJsCallPhone.setOnClickListener(this);
    }

    /**
     * Handle button click events<br />
     * <br />
     * Auto-created on 2018-10-19 13:44:44 by Android Layout Finder
     * (http://www.buzzingandroid.com/tools/android-layout-finder)
     */
    @Override
    public void onClick(View v) {
        if (v == btnJavaAndJs) {
            // Handle clicks for btnJavaAndJs
            Intent intent = new Intent(this, JavaJsMutualActivity.class);
            startActivity(intent);
        } else if (v == btnJsCallJava) {
            // Handle clicks for btnJsCallJava
            Intent intent = new Intent(this, JsJavaVideoActivity.class);
            startActivity(intent);
        } else if (v == btnJsCallPhone) {
            // Handle clicks for btnJsCallPhone
            Intent intent = new Intent(this, JsJavaPhoneActivity.class);
            startActivity(intent);
        }
    }
}
